package org.yzh.web.controller;


import io.github.yezhihao.netmc.core.annotation.AsyncBatch;
import io.github.yezhihao.netmc.core.annotation.Endpoint;
import io.github.yezhihao.netmc.core.annotation.Mapping;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.yzh.commons.util.JackJsonUtils;
import org.yzh.commons.util.R;
import org.yzh.protocol.t808.T0200;
import org.yzh.web.entity.Jt808;
import org.yzh.web.vo.LocationVo;
import org.yzh.web.service.locationService;
import org.yzh.web.vo.ResponseVo;
import org.yzh.web.vo.TrackVo;

import java.util.List;

import static org.yzh.protocol.commons.JT808.位置信息汇报;
@Endpoint
@Slf4j
@RestController
@RequestMapping("/track")
public class TrackController {

    @Autowired
    locationService locationService;

    @PostMapping ("/queryTrack")
    public R queryQualityReport(@RequestBody LocationVo vo) {
        List<TrackVo> entity1  = locationService.queryTrack(vo);
//        String s = JackJsonUtils.objectToJsonString(entity1);
        return R.ok().put("entity1",entity1);
    }

//    @Operation(summary = " 位置信息汇报")
//    @AsyncBatch(poolSize = 2, maxElements = 4000, maxWait = 1000)
//    @Mapping(types = 位置信息汇报, desc = "位置信息汇报")
//    public List T0200(List<T0200> list) {
//        locationService.insert(list);
//        log.info("位置信息:{}",list);
//        return list;
//    }
}
